﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="bootstrap.min.css" rel="stylesheet">
    <link href="font/font-awesome.min.css" rel="stylesheet">
    <link href="cronGen.css" rel="stylesheet">
    <script src="jquery-2.1.4.min.js"></script>
    <script src="later.min.js"></script>
    <title></title>
</head>
<body>
<div class="container">
    <div style="text-align: center; height: 200px; line-height: 200px">Cron表达式生成验证工具</div>
    <input id="cron" class="form-control" style="width: 100%"/>
    <button id="s">最近10次执行时间</button>
    <div id="timeContent"></div>
</div>

<script src="cronGen.min.js"></script>
<script src="bootstrap.min.js"></script>
<script type="text/javascript">
    $('#s').click(function () {
        console.log($("#cron").val())
        run();
    });

    function run() {
        var link = $("#cron").val();
        if (link == '') {
            alert("内容不能空.");
            return;
        }
        console.log(link);
        var sched = later.parse.cron(link);
        later.date.localTime();
        var results = later.schedule(sched).next(10);
        $("#timeContent").html("");
        for (var i = 0; i < results.length; i++) {
            $("#timeContent").append(results[i].toLocaleString() + "<hr/>");
        }
        //toolfk.report('crontab', link);
        return false;
    }

    $(function () {
        $("#cron").cronGen({
            direction: 'bottom'
        });
    });
</script>
</body>
</html>
